Method, apparatus and terminal device for sending broadcast

ABSTRACT

A method, apparatus and terminal device for sending broadcast are provided. The method includes: acquiring a current broadcast message to be sent in a broadcast sending queue, and determining a sending process of the current broadcast message to be sent; determining a sending process of an already sent broadcast message in the broadcast sending queue; and according to whether the sending process of the current broadcast message to be sent is the same sending process as the sending process of the already sent broadcast message, determining whether to send the current broadcast message to be sent to a broadcast recipient of the current broadcast message to be sent while the already sent broadcast message is being processed.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is filed based upon and claims priority to ChinesePatent Application No. 201710140901.4, entitled “Method, Apparatus andTerminal Device for Sending Broadcast”, filed on Mar. 10, 2017. Theentire contents of the application are incorporated herein by reference.

TECHNICAL FIELD

The embodiments of the disclosure relate to a computer technology, andin particular, to a method, apparatus and terminal device for sendingbroadcast.

BACKGROUND

A broadcast is a mechanism widely applied between applications forinformation transmission. For example, an android system implements datatransmission and sharing between applications by means of a broadcastsuch as a short message broadcast and a call broadcast pre-embedded inthe android system.

In the android system, a broadcast sender sends a broadcast message bycalling a sendBroadcast function. A broadcast recipient registers abroadcast receiver with a management module by calling aregisterReceiver function and defines a broadcast message of interest,thus implementing receiving of the corresponding broadcast message.

In the related art, a broadcast sending process is defective, leading tolow efficiency of broadcast processing, high consumption of systemresources and poor system stability.

SUMMARY

Embodiments of the disclosure provide a method, apparatus and terminaldevice for sending broadcast, capable of improving the broadcastprocessing efficiency, reducing the consumption of system resources, andincreasing the system stability.

According to a first aspect, an embodiment of the disclosure provides amethod for sending broadcast. The method is applied to a terminaldevice. The method includes: a current broadcast message to be sent in abroadcast sending queue is acquired, and a sending process of thecurrent broadcast message to be sent is determined; a sending process ofan already sent broadcast message in the broadcast sending queue isdetermined; according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, it is determined whetherto send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed.

According to a second aspect, the embodiment of the disclosure alsoprovides an apparatus for sending broadcast. The apparatus is applied toa terminal device. The apparatus includes one or more processors,wherein the one or more processors execute computer-readableinstructions to implement multiple modules. The multiple modulesincluding: an acquisition module, configured to acquire a currentbroadcast message to be sent in a broadcast sending queue; a firstsending process determining module, configured to determine a sendingprocess of the current broadcast message to be sent; a second sendingprocess determining module, configured to determine a sending process ofan already sent broadcast message in the broadcast sending queue; and acontrol module, configured to determine, according to whether thesending process of the current broadcast message to be sent is the samesending process as the sending process of the already sent broadcastmessage, whether to send the current broadcast message to be sent to abroadcast recipient of the current broadcast message to be sent whilethe already sent broadcast message is being processed.

According to a third aspect, the embodiment of the disclosure alsoprovides a terminal device, including: a processor, a memory and acomputer program that is stored on the memory and is executable on theprocessor. When the processor executes the computer program such that acurrent broadcast message to be sent in a broadcast sending queue isacquired, and a sending process of the current broadcast message to besent is determined; a sending process of an already sent broadcastmessage in the broadcast sending queue is determined; according towhether the sending process of the current broadcast message to be sentis the same sending process as the sending process of the already sentbroadcast message, it is determined whether to send the currentbroadcast message to be sent to a broadcast recipient of the currentbroadcast message to be sent while the already sent broadcast message isbeing processed.

The technical solution provided in the embodiment of the disclosuresolves the problems in the existing broadcast sending, improves thebroadcast processing efficiency, reduces the consumption of systemresources, and increases the system stability.

BRIEF DESCRIPTION OF DRAWINGS

Other features, purposes and advantages of the disclosure will becomemore apparent by reading detailed description made on nonrestrictiveembodiments with reference to the accompanying drawings.

FIG. 1 is a flowchart illustrating a method for sending broadcastaccording to an embodiment of the disclosure.

FIG. 2 is a flowchart illustrating another method for sending broadcastaccording to an embodiment of the disclosure.

FIG. 3 is a flowchart illustrating yet another method for sendingbroadcast according to an embodiment of the disclosure.

FIG. 4 is a structure block diagram illustrating an apparatus forsending broadcast according to an embodiment of the disclosure.

FIG. 5 is a structure diagram illustrating a terminal device accordingto an embodiment of the disclosure.

DETAILED DESCRIPTION

The disclosure will be further illustrated in detail below withreference to the drawings and the embodiments. It will be appreciatedthat specific embodiments described herein are only used to explain thedisclosure and not to limit the disclosure. In addition, it is also tobe noted that, for convenience of description, only parts relevant tothe disclosure, instead of all contents, are illustrated in thedrawings.

Some embodiments of the disclosure provide a method for sendingbroadcast, the method being applied to a terminal device and including:acquiring a current broadcast message to be sent in a broadcast sendingqueue, and determining a sending process of the current broadcastmessage to be sent; determining a sending process of an already sentbroadcast message in the broadcast sending queue; and determining,according to whether the sending process of the current broadcastmessage to be sent is the same sending process as the sending process ofthe already sent broadcast message, whether to send the currentbroadcast message to be sent to a broadcast recipient of the currentbroadcast message to be sent while the already sent broadcast message isbeing processed.

In some embodiments, the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed may include: when the sendingprocess of the current broadcast message to be sent is different fromthe sending process of the already sent broadcast message, sending thecurrent broadcast message to be sent to the broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.

In some embodiments, after sending the current broadcast message to besent to the broadcast recipient of the current broadcast message to besent, the method may further include: removing the already sentbroadcast message from the broadcast sending queue, and storing thealready sent broadcast message in an array; and after receiving afeedback result sent by a current broadcast recipient of the alreadysent broadcast message, sending the already sent broadcast messagestored in the array to a next broadcast recipient of the already sentbroadcast message.

In some embodiments, the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed may include: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,performing control not to send the current broadcast message to be sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed.

In some embodiments, the method may further include: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,acquiring a next broadcast message to be sent, which is after thecurrent broadcast message to be sent, from the broadcast sending queue,and determining a sending process of the next broadcast message to besent; and when the sending process of the next broadcast message to besent is different from the sending process of the already sent broadcastmessage, sending the next broadcast message to be sent to a broadcastrecipient of the next broadcast message to be sent while the alreadysent broadcast message is being processed.

In some embodiments, the sending process of the already sent broadcastmessage may include a sending process, recorded during sending of thebroadcast message, for sending the broadcast message, and the sendingprocess of the already sent broadcast message may be updated accordingto a processing state of the already sent broadcast message.

In some embodiments, it may be determined whether the sending process ofthe current broadcast message to be sent is the same sending process asthe sending process of the already sent broadcast message according toan identification of the sending process of the current broadcastmessage to be sent and an identification of the sending process of thealready sent broadcast message.

Some embodiments of the disclosure provide an apparatus for sendingbroadcast, the apparatus being applied to a terminal device andincluding one or more processors, wherein the one or more processors areconfigured to execute computer-readable instructions to implement aplurality of modules, the plurality of modules including: an acquisitionmodule, configured to acquire a current broadcast message to be sent ina broadcast sending queue; a first sending process determining module,configured to determine a sending process of the current broadcastmessage to be sent; a second sending process determining module,configured to determine a sending process of an already sent broadcastmessage in the broadcast sending queue; and a control module, configuredto determine, according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, whether to send thecurrent broadcast message to be sent to a broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.

In some embodiments, the control module may be specifically configuredto: send, when the sending process of the current broadcast message tobe sent is different from the sending process of the already sentbroadcast message, the current broadcast message to be sent to thebroadcast recipient of the current broadcast message to be sent whilethe already sent broadcast message is being processed.

In some embodiments, the apparatus may further include: a storagemodule, configured to remove, after sending the current broadcastmessage to be sent to the broadcast recipient of the current broadcastmessage to be sent, the already sent broadcast message from thebroadcast sending queue, and store the already sent broadcast message inan array, wherein the control module is further configured to send,after receiving a feedback result sent by a current broadcast recipientof the already sent broadcast message, the already sent broadcastmessage stored in the array to a next broadcast recipient of the alreadysent broadcast message.

In some embodiments, the control module may be specifically configuredto: perform control not to send, when the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, the current broadcastmessage to be sent to the broadcast recipient of the current broadcastmessage to be sent while the already sent broadcast message is beingprocessed.

In some embodiments, the control module may be further configured to:acquire, when the sending process of the current broadcast message to besent is the same sending process as the sending process of the alreadysent broadcast message, a next broadcast message to be sent, which isafter the current broadcast message to be sent, from the broadcastsending queue, and determine a sending process of the next broadcastmessage to be sent; and send, when the sending process of the nextbroadcast message to be sent is different from the sending process ofthe already sent broadcast message, the broadcast message to be sent toa broadcast recipient of the broadcast message to be sent while thealready sent broadcast message is being processed.

In some embodiments, the one or more processors may be furtherconfigured to execute the computer-readable instructions to implement:an update module, configured to update the sending process of thealready sent broadcast message according to a processing state of thealready sent broadcast message, the sending process of the already sentbroadcast message including a sending process, recorded during sendingof the broadcast message, for sending the broadcast message.

In some embodiments, the control module may be configured to determinewhether the sending process of the current broadcast message to be sentis the same sending process as the sending process of the already sentbroadcast message according to an identification of the sending processof the current broadcast message to be sent and an identification of thesending process of the already sent broadcast message.

Some embodiments of the disclosure provide a terminal device, including:a processor, a memory and a computer program that is stored on thememory and is executable on the processor, wherein when the processor isconfigured to executes the computer program for: acquiring a currentbroadcast message to be sent in a broadcast sending queue, anddetermining a sending process of the current broadcast message to besent; determining a sending process of an already sent broadcast messagein the broadcast sending queue; and determining, according to whetherthe sending process of the current broadcast message to be sent is thesame sending process as the sending process of the already sentbroadcast message, whether to send the current broadcast message to besent to a broadcast recipient of the current broadcast message to besent while the already sent broadcast message is being processed.

In some embodiments, the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed may include: when the sendingprocess of the current broadcast message to be sent is different fromthe sending process of the already sent broadcast message, sending thecurrent broadcast message to be sent to the broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.

In some embodiments, the processor is configured to execute the computerprogram for performing: after sending the current broadcast message tobe sent to the broadcast recipient of the current broadcast message tobe sent, removing the already sent broadcast message from the broadcastsending queue, and storing the already sent broadcast message in anarray; and after receiving a feedback result sent by a current broadcastrecipient of the already sent broadcast message, sending the alreadysent broadcast message stored in the array to a next broadcast recipientof the already sent broadcast message.

In some embodiments, the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed may include: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,performing control not to send the current broadcast message to be sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed.

In some embodiments, the processor may be configured to execute thecomputer program for performing: when the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, acquiring a nextbroadcast message to be sent, which is after the current broadcastmessage to be sent, from the broadcast sending queue, and determining asending process of the next broadcast message to be sent; and when thesending process of the next broadcast message to be sent is differentfrom the sending process of the already sent broadcast message, sendingthe next broadcast message to be sent to a broadcast recipient of thenext broadcast message to be sent while the already sent broadcastmessage is being processed.

In some embodiments, the sending process of the already sent broadcastmessage may include a sending process, recorded during sending of thebroadcast message, for sending the broadcast message, and the sendingprocess of the already sent broadcast message may be updated accordingto a processing state of the already sent broadcast message.

According to a fourth aspect, some embodiments of the disclosure providea non-transitory computer-readable storage medium having stored thereoninstructions that, when executed by a processor, cause the processor toperform the method for sending broadcast as described above.

FIG. 1 is a flowchart illustrating a method for sending broadcastaccording to an embodiment of the disclosure. The present embodiment canbe applied to a situation of controlling broadcast sending in a system.The method may be executed by a terminal device provided in theembodiment of the disclosure. An apparatus for sending broadcast of theterminal device may be implemented in a software manner and/or ahardware manner. As illustrated in FIG. 1, a specific solution providedin the present embodiment is as follows.

In a block S101, a current broadcast message to be sent in a broadcastsending queue is acquired, and a sending process of the currentbroadcast message to be sent is determined.

In a broadcast mechanism, a broadcast message refers to information sentin a running process of a system or an application and transmittedbetween the system and the application. Exemplarily, the broadcastmessage may be a system starting broadcast message, a short-messagebroadcast message, a call broadcast message or a third party applicationbroadcast message.

During broadcast processing, a service process of a broadcast sendersends a broadcast message to a management module (e.g.,ActivityManagerService) by calling a broadcast sending function (e.g., asendBroadcast function). After receiving the broadcast message, themanagement module puts the broadcast message into a broadcast sendingqueue. The management module sends the broadcast message in thebroadcast sending queue to a broadcast recipient satisfying a receivingcondition by means of a process communication mechanism (e.g., a Binderprocess communication mechanism).

In one embodiment, the management module sends the broadcast messages inthe broadcast sending queue in sequence. The broadcast message sendingprocess of the broadcast sender and the broadcast message receivingprocess of the broadcast recipient are asynchronous operation processes.The broadcast sender and the broadcast recipient are matched in alow-coupling relation by means of the management module. Here, thebroadcast messages may be classified into normal broadcast messages andordered broadcast messages according to different broadcast sendingmanners. After normal broadcast messages are sent by the managementmodule, broadcast recipients receive the broadcast messages out oforder. By contrast, after ordered broadcast messages are sent by themanagement module, the broadcast recipients sequentially receive thebroadcast messages in an order. That is, only when the first broadcastrecipient receives a broadcast message and completely processes thebroadcast message, the second broadcast recipient can start to receiveand process the broadcast message, and this principle may also apply tothe next recipients. The present embodiment may be applied to a case ofcontrolling over processing of the ordered broadcast messages.Specifically, in a case where a broadcast recipient receives a broadcastmessage, the management module may acquire a register instruction for abroadcast receiver. The register instruction for the broadcast receivermay be sent by the broadcast recipient. Usually, the broadcast recipientregisters (subscribes for) a broadcast message to be received in themanagement module by means of the process communication mechanism. Aservice process of the broadcast recipient registers the broadcastreceiver in the management module by calling a registerReceiverfunction, and defines a broadcast message of interest. When sending abroadcast message in the broadcast sending queue, the management modulesends, according to the register situation of a broadcast recipient, thebroadcast message to a message cycle queue corresponding to thebroadcast recipient who subscribes for the broadcast message. Afterreceiving the broadcast message, the broadcast recipient calls back areceiving method (e.g., an onReceive method) in the registered broadcastreceiver to execute corresponding functions so as to process thereceived broadcast message.

In one embodiment, a current broadcast message to be sent in thebroadcast sending queue is acquired, and a process of a broadcast sendercorresponding to the broadcast message is determined. The currentbroadcast message to be sent may be a broadcast message to beimmediately processed in the broadcast queue. That is, an already sentbroadcast message is being processed, and after the already sentbroadcast message is completely processed, the current broadcast messageto be sent will be processed. Specifically, when sending the broadcastmessage, the broadcast sender will start a corresponding process. Theprocess refers to a running activity of a program in the system about acertain data set, is a basic unit of the system for resource allocationand scheduling, is a composition basis of a system structure, and is abasic executive subject of the application. A counter application willbe taken as an example for a broadcast sender. The broadcast messagesending process of the counter application may be expressed as:

//create a broadcast message

Intent intent=new Intent (BROADCAST_COUNTER_ACTION);

//transfer counter parameters and corresponding count values

intent.putExtra (COUNTER_VALUE, counter);

//send the broadcast message

sendBroadcast (intent)

In the present embodiment, when the acquired broadcast message isBROADCAST_COUNTER_ACTION, a sending process used for sending thebroadcast message BROADCAST_COUNTER_ACTION is determined. Exemplarily,the sending process can be determined according to a correspondingprocess ID.

In a block S102, a sending process of an already sent broadcast messagein the broadcast sending queue is determined.

In one embodiment, an already sent broadcast message in the broadcastsending queue is acquired, and a corresponding sending process forsending the broadcast message is determined according to the contents ofthe already sent broadcast message. The specific process is as mentionedin the block S101 and will not be elaborated here.

In a block S103, according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, it is determined whetherto send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed.

In the block S103, according to the sending process, that corresponds tothe current broadcast message to be sent and is determined in a blockS101, and the sending process, that corresponds to the already sentbroadcast message and is determined in a block S102, it is determinedwhether to send the current broadcast message to be sent while thealready sent broadcast message is being processed.

In one embodiment, when the sending process of the current broadcastmessage to be sent is different from the sending process of the alreadysent broadcast message, the current broadcast message to be sent is sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed. In thepresent embodiment, since the sending process of the current broadcastmessage to be sent is different from the sending process of the alreadysent broadcast message, the current broadcast message to be sent may besent instantly without waiting for processing of the previous broadcastmessage to be finished, thereby implementing parallel sending of anordered broadcast queue.

It is to be noted that in one embodiment, the solution is to control andprocess the broadcast sending queue. Here, it is monitored that themanagement module sends a broadcast message according to an order ofbroadcast messages in the broadcast sending queue, and a process of thecurrent broadcast message to be sent may be determined.

According to the technical solution provided in the present embodiment,a current broadcast message to be sent in a broadcast sending queue isacquired, and a sending process of the current broadcast message to besent is determined; a sending process of an already sent broadcastmessage in the broadcast sending queue is determined; and according towhether the sending process of the current broadcast message to be sentis the same sending process as the sending process of the already sentbroadcast message, it is determined whether to send the currentbroadcast message to be sent to a broadcast recipient of the currentbroadcast message to be sent while the already sent broadcast message isbeing processed. Thus, the problem of low broadcast processingefficiency caused by the fact that a next broadcast message can be sentonly when an already sent broadcast message is completely processed inan existing ordered broadcast sending queue is solved, thereby greatlyshortening the processing time of a broadcast queue.

FIG. 2 is a flowchart illustrating another method for sending broadcastaccording to an embodiment of the disclosure. On the basis of theabove-mentioned embodiment, the method for sending broadcast may furtherinclude: after sending the current broadcast message to be sent to thebroadcast recipient of the current broadcast message to be sent,removing the already sent broadcast message from the broadcast sendingqueue, and storing the already sent broadcast message in an array; andafter receiving a feedback result sent by a current broadcast recipientof the already sent broadcast message, sending the already sentbroadcast message stored in the array to a next broadcast recipient ofthe already sent broadcast message.

On the basis of the above-mentioned optimization, as illustrated in FIG.2, the technical solution provided in the present embodiment may be asfollows specifically.

In a block S201, a current broadcast message to be sent in a broadcastsending queue is acquired, a sending process of the current broadcastmessage to be sent is determined, and a sending process of an alreadysent broadcast message in the broadcast sending queue is determined.

In a block S202, according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, it is determined whetherto send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed.

In a block S203, the already sent broadcast message is removed from thebroadcast sending queue, and is stored in an array.

In one embodiment, when a broadcast message is sent and processed, thebroadcast message that is being processed is reserved in the broadcastqueue, and when a feedback is given after the broadcast message iscompletely processed, the broadcast message is removed from thebroadcast queue. In the present embodiment, when it is determined thatthe sending process of the current broadcast message to be sent is notthe same sending process as the sending process of the already sentbroadcast message, the broadcast message to be sent is sent in time andprocessed. In this case, optionally, the already sent broadcast messagein the broadcast queue is removed from the broadcast queue and stored inan array. The array may be a new array, used for storing the alreadysent broadcast message.

In a block S204, after receiving a feedback result sent by a broadcastrecipient of the already sent broadcast message, the already sentbroadcast message stored in the array is sent to a next broadcastrecipient of the already sent broadcast message.

In one embodiment, the broadcast recipient will feed a processing resultback after the corresponding broadcast message is completely processed.When the processing feedback result is received, the broadcast messageis sent to the next broadcast recipient for being processed. Here, aregister process of receiving a broadcast message by a broadcastrecipient may be expressed as (for example, when a broadcast messagesent by a counter is to be received):

//define a broadcast message of interest (subscribe for a broadcastmessage)

IntentFiltercounterActionFilter=

newIntentFilter (CounterService.BROADCAST_COUNTER_ACTION);

//register a broadcast receiver

registerReceiver (counterActionReceiver,counterActionFilter)

When a broadcast message (BROADCAST_COUNTER_ACTION) sent by thebroadcast sender has been sent by a management module, the broadcastmessage will be received and processed by a corresponding broadcastrecipient since the broadcast recipient registers a broadcast receiverfor receiving the broadcast message.

In one embodiment, the already sent broadcast message is removed fromthe broadcast queue and stored in the new array. After the feedbackresult is received, the new array will be looked up for the broadcastmessage. The broadcast message is then sent to the next broadcastrecipient. Thus, the parallel sending of the broadcast messages in theordered broadcast queue can be implemented, and each broadcast messageis processed in order. This further optimizes a broadcast sendingprocessing manner, improves the broadcast processing efficiency, andensures the orderliness of broadcast message processing.

FIG. 3 is a flowchart illustrating another method for sending broadcastaccording to an embodiment of the disclosure. On the basis of theabove-mentioned embodiment, optionally, when the sending process of thecurrent broadcast message to be sent is the same sending process as thesending process of the already sent broadcast message, control will beperformed such that the current broadcast message to be sent is not sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed. A nextbroadcast message to be sent, which is after the current broadcastmessage to be sent, is acquired from the broadcast sending queue. Thesending process of the next broadcast message to be sent is determined;and when the sending process of the next broadcast message to be sent isdifferent from the sending process of the already sent broadcastmessage, the next broadcast message to be sent is sent to a broadcastrecipient of the next broadcast message to be sent while the alreadysent broadcast message is being processed.

On the basis of the above-mentioned optimization, as illustrated in FIG.3, the technical solution provided in the present embodiment is asfollows specifically.

In a block S301, a current broadcast message to be sent in a broadcastsending queue is acquired, and a sending process of the currentbroadcast message to be sent is determined.

In a block S302, a sending process of an already sent broadcast messagein the broadcast sending queue is determined.

In a block S303, it is judged whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message. When the sending processof the current broadcast message to be sent is the same sending processas the sending process of the already sent broadcast message, a blockS304 and a block S305 are executed.

In the block S304, control is performed such that the current broadcastmessage to be sent is not sent to the broadcast recipient of the currentbroadcast message to be sent while the already sent broadcast message isbeing processed.

In one embodiment, when it is determined that the sending process of thecurrent broadcast message to be sent is the same sending process as thesending process of the already sent broadcast message, control isperformed such that the current broadcast message to be sent is not sentbut will be sent after the broadcast message in the same process iscompletely processed, for avoiding occupancy of the same process.

In a block S305, a next broadcast message to be sent, which is after thecurrent broadcast message to be sent, is acquired from the broadcastsending queue, and a sending process of the next broadcast message to besent is determined. When the sending process of the next broadcastmessage to be sent is different from the sending process of the alreadysent broadcast message, the next broadcast message to be sent is sent toa broadcast recipient of the next broadcast message to be sent while thealready sent broadcast message is being processed.

In one embodiment, according to an order of broadcast messages in thebroadcast queue, it is sequentially determined whether to send thebroadcast messages. When a sending process of a broadcast message isdifferent from the sending process of the already sent broadcastmessage, the broadcast message is sent while the already sent broadcastmessage is being processed. When the sending process of the broadcastmessage is the same sending process as the sending process of thealready sent broadcast message, a next broadcast message is continuouslyacquired, and a corresponding sending process is determined to determinewhether to send the broadcast message.

The present embodiment provides a method for sending broadcast. When thesending process of the current broadcast message to be sent is the samesending process as the sending process of the already sent broadcastmessage, control is performed such that the current broadcast message tobe sent is not sent to the broadcast recipient of the current broadcastmessage to be sent while the already sent broadcast message is beingprocessed; a next broadcast message to be sent, which is after thecurrent broadcast message to be sent, is acquired from the broadcastsending queue, and a sending process of the next broadcast message to besent is determined; and when the sending process of the next broadcastmessage to be sent is different from the sending process of the alreadysent broadcast message, the next broadcast message to be sent is sent toa broadcast recipient of the next broadcast message to be sent while thealready sent broadcast message is being processed. Thus, parallelsending of an ordered broadcast queue is implemented, the broadcastprocessing efficiency is improved, and the power consumption of a systemis reduced.

On the basis of the above-mentioned technical solution, in oneembodiment, the sending process of the already sent broadcast messageincludes a sending process, recorded during sending of the broadcastmessage, for sending the broadcast message, and the sending process ofthe already sent broadcast message is updated according to a processingstate of the already sent broadcast message. During determination of asending process of a broadcast message in a broadcast sending queue,since there may be a great number of broadcast messages in the broadcastsending queue, when it is determined that a sending process of abroadcast message is the same sending process as a sending process ofthe already sent broadcast message, the already sent broadcast messagethat is previously recorded has been processed completely to release acorresponding process. In the present solution, the sending process ofthe already sent broadcast message is updated according to a processingstate of the already sent broadcast message. If processing is completed,the process is correspondingly set to be not occupied so as to send anew broadcast message.

FIG. 4 is a structure block diagram illustrating an apparatus forsending broadcast according to an embodiment of the disclosure. Theapparatus is configured to execute the method for sending broadcastprovided in the above-mentioned embodiment, and has correspondingfunctional modules for executing the method as well as beneficialeffects of the method. As illustrated in FIG. 4, the apparatusspecifically includes: an acquisition module 401, a first sendingprocess determining module 402, a second sending process determiningmodule 403 and a control module 404.

The acquisition module 401 is configured to acquire a current broadcastmessage to be sent in a broadcast sending queue.

The first sending process determining module 402 is configured todetermine a sending process of the current broadcast message to be sent.

The second sending process determining module 403 is configured todetermine a sending process of an already sent broadcast message in thebroadcast sending queue.

The control module 404 is configured to determine, according to whetherthe sending process of the current broadcast message to be sent is thesame sending process as the sending process of the already sentbroadcast message, whether to send the current broadcast message to besent to a broadcast recipient of the current broadcast message to besent while the already sent broadcast message is being processed.

The technical solution provided in the present embodiment solves theproblems in the existing broadcast sending, improves the broadcastprocessing efficiency, reduces the consumption of system resources, andincreases the system stability.

Optionally, the control module 404 may be specifically configured to:send, when the sending process of the current broadcast message to besent is different from the sending process of the already sent broadcastmessage, the current broadcast message to be sent to the broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed.

Optionally, the broadcast sending apparatus may further include: astorage module 405. The storage module 405 is configured to remove,after sending the current broadcast message to be sent to the broadcastrecipient of the current broadcast message to be sent, the already sentbroadcast message from the broadcast sending queue, and store thealready sent broadcast message in an array. In this case, the controlmodule 404 may be further configured to send, after receiving a feedbackresult sent by a current broadcast recipient of the already sentbroadcast message, the already sent broadcast message stored in thearray to a next broadcast recipient of the already sent broadcastmessage.

Optionally, the control module 404 may be specifically configured to:perform control not to send, when the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, the current broadcastmessage to be sent to the broadcast recipient of the current broadcastmessage to be sent while the already sent broadcast message is beingprocessed; acquire a next broadcast message to be sent, which is afterthe current broadcast message to be sent, from the broadcast sendingqueue, and determine a sending process of the broadcast message to besent; and send, when the sending process of the broadcast message to besent is different from the sending process of the already sent broadcastmessage, the broadcast message to be sent to a broadcast recipient ofthe broadcast message to be sent while the already sent broadcastmessage is being processed.

Optionally, the broadcast sending apparatus may further include anupdate module 405. The update module 405 is configured to update thesending process of the already sent broadcast message according to aprocessing state of the already sent broadcast message. The sendingprocess of the already sent broadcast message includes a sendingprocess, recorded during sending of the broadcast message, for sendingthe broadcast message.

The present embodiment provides a terminal device on the basis of eachof the above-mentioned embodiments. The terminal device may include anapparatus for sending broadcast provided in the disclosure. FIG. 5 is astructure diagram illustrating a terminal device according toembodiments of the disclosure. As illustrated in FIG. 5, the terminaldevice may include: a memory 501, a Central Processing Unit (CPU) 502, aperipheral interface 503, a Radio Frequency (RF) circuit 505, an audiocircuit 506, a loudspeaker 511, a power management chip 508, anInput/Output (I/O) subsystem 509, a touch screen 512, otherinput/control devices 510 and an external port 504, which communicatethrough one or more communication buses or signal lines 507.

It will be appreciated that the terminal device 500 illustrated in thefigure is only an example of a terminal device, and the terminal device500 may have components more or less than those illustrated in thefigure. two or more components of the terminal device 500 may becombined, or the terminal device 500 may have different componentconfigurations. Various components illustrated in the figure may beimplemented in hardware, software, or a combination of hardware andsoftware. The hardware may include one or more signal processing and/ordedicated integrated circuits.

A terminal device for sending broadcast provided in the presentembodiment will be described in detail below. A smart phone is taken asan example of the terminal device.

The memory 501 may be accessed by the CPU 502, the peripheral interface503 and the like. The memory 501 may include a high-speed random accessmemory.

Or the memory 501 may include a nonvolatile memory such as one or moredisk storage apparatuses, a flash apparatus or other volatile solidstorage apparatuses.

The peripheral interface 503 may connect input and output peripherals ofthe device to the CPU 502 and the memory 501.

The I/O subsystem 509 may connect the input and output peripherals onthe device, such as the touch screen 512 and the other input/controldevices 510, to the peripheral interface 503. The I/O subsystem 509 mayinclude a display controller 5091 and one or more input controllers 5092for controlling the other input/control devices 510. Here, the one ormore input controllers 5092 receive an electric signal from the otherinput/control devices 510 or send an electric signal to the otherinput/control devices 510. The other input/control devices 510 mayinclude a physical button (e.g. press button, rocker button, etc.), adial, a sliding switch, an operating rod and a clicking roller. It is tobe noted that the input controller 5092 may be connected to any one of akeyboard, an infrared port, a Universal Serial Bus (USB) interface and apointing device such as a mouse.

The touch screen 512 is an input interface and an output interfacebetween a user terminal and a user, and displays a visual output to theuser. Here, the visual output may include a graph, a text, an icon, avideo and the like.

The display controller 5091 in the I/O subsystem 509 receives anelectric signal from the touch screen 512 or sends an electric signal tothe touch screen 512. The touch screen 512 detects a contact on thetouch screen. The display controller 5091 converts the detected contactinto an interaction with a user interface object displayed on the touchscreen 512 to realize a human-computer interaction. The user interfaceobject displayed on the touch screen 512 may be an icon of game running,an icon of connection to a corresponding network, or the like. It is tobe noted that the device may further include an optical mouse, which isa touch-sensitive surface that does not display the visual output or anextension of a touch-sensitive surface formed by the touch screen.

The RF circuit 505 is mainly used for establishing communicationsbetween a mobile phone and a wireless network (i.e., network side) torealize data receiving and sending between the mobile phone and thewireless network such as receiving and sending of a short message, anE-mail and the like. Specifically, the RF circuit 505 receives and sendsan RF signal that is also referred to as an electromagnetic signal, andthe RF circuit 505 converts an electric signal into an electromagneticsignal or converts an electromagnetic signal into an electric signal,and communicates with a communication network and other devices throughthe electromagnetic signal. The RF circuit 505 may include a knowncircuit for executing these functions, which includes, but is notlimited to, an antenna system, an RF transceiver, one or moreamplifiers, a tuner, one or more oscillators, a digital signalprocessor, a Coder-Decoder (CODEC) chip group, a Subscriber IdentityModule (SIM) and the like.

The audio circuit 506 is mainly used for receiving audio data from theperipheral interface 503, converting the audio data into an electricsignal, and sending the electric signal to the loudspeaker 511.

The loudspeaker 511 is used for restoring a voice signal that isreceived, by the mobile phone, from the wireless network through the RFcircuit 505 into a sound, and playing the sound to the user.

The power management chip 508 is used for performing power supply andpower management on hardware connected to the CPU 502, the I/O subsystemand the peripheral interface.

The CPU 502 provided in the embodiment of the disclosure may execute thefollowing operations:

acquiring a current broadcast message to be sent in a broadcast sendingqueue, and determining a sending process of the current broadcastmessage to be sent;

determining a sending process of an already sent broadcast message inthe broadcast sending queue; and

determining, according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, whether to send thecurrent broadcast message to be sent to a broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.

Optionally, the determining, according to whether the sending process ofthe current broadcast message to be sent is the same sending process asthe sending process of the already sent broadcast message, whether tosend the current broadcast message to be sent to a broadcast recipientof the current broadcast message to be sent while the already sentbroadcast message is being processed includes: when the sending processof the current broadcast message to be sent is different from thesending process of the already sent broadcast message, sending thecurrent broadcast message to be sent to the broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.

Optionally, after sending the current broadcast message to be sent tothe broadcast recipient of the current broadcast message to be sent, theoperation further includes: removing the already sent broadcast messagefrom the broadcast sending queue, and storing the already sent broadcastmessage in an array; and after receiving a feedback result sent by acurrent broadcast recipient of the already sent broadcast message,sending the already sent broadcast message stored in the array to a nextbroadcast recipient of the already sent broadcast message.

Optionally, the determining, according to whether the sending process ofthe current broadcast message to be sent is the same sending process asthe sending process of the already sent broadcast message, whether tosend the current broadcast message to be sent to a broadcast recipientof the current broadcast message to be sent while the already sentbroadcast message is being processed includes: when the sending processof the current broadcast message to be sent is the same sending processas the sending process of the already sent broadcast message, performingcontrol not to send the current broadcast message to be sent to thebroadcast recipient of the current broadcast message to be sent whilethe already sent broadcast message is being processed; acquiring a nextbroadcast message to be sent, which is after the current broadcastmessage to be sent, from the broadcast sending queue, and determining asending process of the broadcast message to be sent; and when thesending process of the broadcast message to be sent is different fromthe sending process of the already sent broadcast message, sending thebroadcast message to be sent to a broadcast recipient of the broadcastmessage to be sent while the already sent broadcast message is beingprocessed.

Alternatively, the sending process of the already sent broadcast messageincludes a sending process, recorded during sending of the broadcastmessage, for sending the broadcast message, and the sending process ofthe already sent broadcast message is updated according to a processingstate of the already sent broadcast message.

It is to be noted that the above is only the preferable embodiments andtechnical principle of the disclosure. A person skilled in the art willunderstand that the disclosure is not limited to the specificembodiments here. As will occur to a person skilled in the art, variousobvious changes, re-adjustments and replacements can be made withoutdeparting from the scope of protection of the disclosure. Therefore,although the disclosure is described in detail through the aboveembodiments, the disclosure is not limited to the above embodiments,more other equivalent embodiments may also be included without departingfrom the concept of the disclosure, and the scope of the disclosure isdefined by the scope of the appended claims.

1. A method for sending broadcast, the method being applied to aterminal device and comprising: acquiring a current broadcast message tobe sent in a broadcast sending queue, and determining a sending processof the current broadcast message to be sent; determining a sendingprocess of an already sent broadcast message in the broadcast sendingqueue; and determining, according to whether the sending process of thecurrent broadcast message to be sent is the same sending process as thesending process of the already sent broadcast message, whether to sendthe current broadcast message to be sent to a broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.
 2. The method according to claim 1, whereinthe determining, according to whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, whether to send thecurrent broadcast message to be sent to a broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed comprises: when the sending process of thecurrent broadcast message to be sent is different from the sendingprocess of the already sent broadcast message, sending the currentbroadcast message to be sent to the broadcast recipient of the currentbroadcast message to be sent while the already sent broadcast message isbeing processed.
 3. The method according to claim 2, wherein aftersending the current broadcast message to be sent to the broadcastrecipient of the current broadcast message to be sent, the methodfurther comprises: removing the already sent broadcast message from thebroadcast sending queue, and storing the already sent broadcast messagein an array; and after receiving a feedback result sent by a currentbroadcast recipient of the already sent broadcast message, sending thealready sent broadcast message stored in the array to a next broadcastrecipient of the already sent broadcast message.
 4. The method accordingto claim 1, wherein determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed comprises: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,performing control not to send the current broadcast message to be sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed.
 5. Themethod according to claim 4, further comprising: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,acquiring a next broadcast message to be sent, which is after thecurrent broadcast message to be sent, from the broadcast sending queue,and determining a sending process of the next broadcast message to besent; and when the sending process of the next broadcast message to besent is different from the sending process of the already sent broadcastmessage, sending the next broadcast message to be sent to a broadcastrecipient of the next broadcast message to be sent while the alreadysent broadcast message is being processed.
 6. The method according toclaim 1, wherein the sending process of the already sent broadcastmessage comprises a sending process, recorded during sending of thebroadcast message, for sending the broadcast message, and the sendingprocess of the already sent broadcast message is updated according to aprocessing state of the already sent broadcast message.
 7. The methodaccording to claim 1, wherein it is determined whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast messageaccording to an identification of the sending process of the currentbroadcast message to be sent and an identification of the sendingprocess of the already sent broadcast message.
 8. An apparatus forsending broadcast, the apparatus being applied to a terminal device andcomprising one or more processors, wherein the one or more processorsare configured to execute computer-readable instructions to implement aplurality of modules, the plurality of modules comprising: anacquisition module, configured to acquire a current broadcast message tobe sent in a broadcast sending queue; a first sending processdetermining module, configured to determine a sending process of thecurrent broadcast message to be sent; a second sending processdetermining module, configured to determine a sending process of analready sent broadcast message in the broadcast sending queue; and acontrol module, configured to determine, according to whether thesending process of the current broadcast message to be sent is the samesending process as the sending process of the already sent broadcastmessage, whether to send the current broadcast message to be sent to abroadcast recipient of the current broadcast message to be sent whilethe already sent broadcast message is being processed.
 9. The apparatusaccording to claim 8, wherein the control module is specificallyconfigured to: send, when the sending process of the current broadcastmessage to be sent is different from the sending process of the alreadysent broadcast message, the current broadcast message to be sent to thebroadcast recipient of the current broadcast message to be sent whilethe already sent broadcast message is being processed.
 10. The apparatusaccording to claim 9, wherein the one or more processors are furtherconfigured to execute the computer-readable instructions to implement: astorage module, configured to remove, after sending the currentbroadcast message to be sent to the broadcast recipient of the currentbroadcast message to be sent, the already sent broadcast message fromthe broadcast sending queue, and store the already sent broadcastmessage in an array, wherein the control module is further configured tosend, after receiving a feedback result sent by a current broadcastrecipient of the already sent broadcast message, the already sentbroadcast message stored in the array to a next broadcast recipient ofthe already sent broadcast message.
 11. The apparatus according to claim8, wherein the control module is specifically configured to: performcontrol not to send, when the sending process of the current broadcastmessage to be sent is the same sending process as the sending process ofthe already sent broadcast message, the current broadcast message to besent to the broadcast recipient of the current broadcast message to besent while the already sent broadcast message is being processed. 12.The apparatus according to claim 11, wherein the control module isfurther configured to: acquire, when the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message, a next broadcast messageto be sent, which is after the current broadcast message to be sent,from the broadcast sending queue, and determine a sending process of thenext broadcast message to be sent; and send, when the sending process ofthe next broadcast message to be sent is different from the sendingprocess of the already sent broadcast message, the broadcast message tobe sent to a broadcast recipient of the broadcast message to be sentwhile the already sent broadcast message is being processed.
 13. Theapparatus according to claim 8, wherein the one or more processors arefurther configured to execute the computer-readable instructions toimplement: an update module, configured to update the sending process ofthe already sent broadcast message according to a processing state ofthe already sent broadcast message, the sending process of the alreadysent broadcast message comprising a sending process, recorded duringsending of the broadcast message, for sending the broadcast message. 14.The apparatus according to claim 8, wherein the control module isconfigured to determine whether the sending process of the currentbroadcast message to be sent is the same sending process as the sendingprocess of the already sent broadcast message according to anidentification of the sending process of the current broadcast messageto be sent and an identification of the sending process of the alreadysent broadcast message.
 15. A terminal device, comprising: a processor,a memory and a computer program that is stored on the memory and isexecutable on the processor, wherein when the processor is configured toexecutes the computer program for: acquiring a current broadcast messageto be sent in a broadcast sending queue, and determining a sendingprocess of the current broadcast message to be sent; determining asending process of an already sent broadcast message in the broadcastsending queue; and determining, according to whether the sending processof the current broadcast message to be sent is the same sending processas the sending process of the already sent broadcast message, whether tosend the current broadcast message to be sent to a broadcast recipientof the current broadcast message to be sent while the already sentbroadcast message is being processed.
 16. The terminal device accordingto claim 15, wherein the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed comprises: when the sendingprocess of the current broadcast message to be sent is different fromthe sending process of the already sent broadcast message, sending thecurrent broadcast message to be sent to the broadcast recipient of thecurrent broadcast message to be sent while the already sent broadcastmessage is being processed.
 17. The terminal device according to claim16, wherein the processor is configured to execute the computer programfor performing: after sending the current broadcast message to be sentto the broadcast recipient of the current broadcast message to be sent,removing the already sent broadcast message from the broadcast sendingqueue, and storing the already sent broadcast message in an array; andafter receiving a feedback result sent by a current broadcast recipientof the already sent broadcast message, sending the already sentbroadcast message stored in the array to a next broadcast recipient ofthe already sent broadcast message.
 18. The terminal device according toclaim 15, wherein the determining, according to whether the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,whether to send the current broadcast message to be sent to a broadcastrecipient of the current broadcast message to be sent while the alreadysent broadcast message is being processed comprises: when the sendingprocess of the current broadcast message to be sent is the same sendingprocess as the sending process of the already sent broadcast message,performing control not to send the current broadcast message to be sentto the broadcast recipient of the current broadcast message to be sentwhile the already sent broadcast message is being processed.
 19. Theterminal device according to claim 18, wherein the processor isconfigured to execute the computer program for performing: when thesending process of the current broadcast message to be sent is the samesending process as the sending process of the already sent broadcastmessage, acquiring a next broadcast message to be sent, which is afterthe current broadcast message to be sent, from the broadcast sendingqueue, and determining a sending process of the next broadcast messageto be sent; and when the sending process of the next broadcast messageto be sent is different from the sending process of the already sentbroadcast message, sending the next broadcast message to be sent to abroadcast recipient of the next broadcast message to be sent while thealready sent broadcast message is being processed.
 20. The terminaldevice according to claim 15, wherein the sending process of the alreadysent broadcast message comprises a sending process, recorded duringsending of the broadcast message, for sending the broadcast message, andthe sending process of the already sent broadcast message is updatedaccording to a processing state of the already sent broadcast message.